//
//  INAccountViewController.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/10/17.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "INAccountViewController.h"
#import "CandLViewController.h"
#import "NonAcountViewController.h"
@interface INAccountViewController ()

@property(nonatomic,strong)CandLViewController *CandVC;

@property(nonatomic,strong)NonAcountViewController *NonVC;

@end

@implementation INAccountViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addChildViewController:self.CandVC];
    
    [self addChildViewController:self.NonVC];
    
    [self.backScrollView addSubview:self.CandVC.view];
    
    [self.backScrollView addSubview:self.NonVC.view];
    
    // Do any additional setup after loading the view.
}

-(CandLViewController*)CandVC
{
    if (!_CandVC) {
        
         JobListModel *list=[JobListModel new];
        _CandVC=[CandLViewController new];
 
        if ([self getUserType]==1) {
            
            _CandVC.isEdit=YES;
            
            _CandVC.isdeleMore=YES;
            
            list.shopId=[LoginStatuesModel shopId];
            
        }else{
            
            _CandVC.isEdit=NO;
            
            _CandVC.isdeleMore=NO;
            
            if ([self getUserType]==3) {
                
                list.marketId=[LoginStatuesModel getStaffId];
            }
            
        }
        
        _CandVC.searchName=@"输入关键字";
        _CandVC.AddBtnTitle=@"新增进货";
        _CandVC.isAutoLoding=YES;
        _CandVC.view.frame=CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-64);
        _CandVC.title=@"餐饮/流通";
        
        _CandVC.Reqmodel=list;
    }
    return _CandVC;
}

-(NonAcountViewController*)NonVC
{
    if (!_NonVC) {
        
        JobListModel *list=[JobListModel new];
        _NonVC=[NonAcountViewController new];
    
        
        if ([self getUserType]==1) {
            
            _NonVC.isEdit=YES;
            
            _NonVC.isdeleMore=YES;
            
            list.shopId=[LoginStatuesModel shopId];
            
        }else{
            
            _NonVC.isEdit=NO;
            
            _NonVC.isdeleMore=NO;
            
            if ([self getUserType]==3) {
                
                list.marketId=[LoginStatuesModel getStaffId];
            }
            
        }
        
        _NonVC.AddBtnTitle=@"新增进货";
        _CandVC.isAutoLoding=NO;//懒加载
        _NonVC.searchName=@"输入关键字";
        
        _NonVC.title=@"农产品";
        
        _NonVC.view.frame=CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT-64);
        
          _NonVC.Reqmodel=list;
     
    }
    
    return _NonVC;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
